import { defineStore } from "pinia";
const useUserStore = defineStore('user', { 
    state: () => ({
       userName: "",
       id: '', 
       password: "",
       account: '',
       role: '',
       status: '',
    }),
    persist: {
        enabled: true,
    } ,//pinia-plugin-persist设置持久化操作
    actions: {        
        getUser() {
            
        },
        setUser(name: string, id: string, password: string) {
            this.name = name;
            this.id = id;
            this.password = password;
        },
        layout(){
            this.userName = "";
            this.id = ''; 
            this.password = "";
            this.account = '';
            this.role = '';
            this.status = '';
        }
    },
});

export { useUserStore };